package com.wq.controller;

import com.wq.Result;
import com.wq.entity.Type;
import com.wq.service.TypeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wq
 * @since 2025-11-09
 */
@RestController
@RequestMapping("/type")
public class TypeController {

    @Resource
    private TypeService typeService;

    /**
     * 获取启用的请假类型列表
     */
    @GetMapping("/enabled")
    public Result<List<Type>> getEnabledTypes() {
        List<Type> types = typeService.getEnabledTypes();
        return Result.success(types);
    }
}
